//
//  BaseViewController.m
//  Hello
//
//  Created by Detailscool on 16/3/17.
//  Copyright © 2016年 Detailscool. All rights reserved.
//

#import "BaseViewController.h"
#import "SettingCell.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([SettingCell class]) bundle:nil] forCellReuseIdentifier:@"base"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return self.groups.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    SettingGroup * group = self.groups[section];
    
    return group.models.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    SettingCell * cell = [SettingCell settingCellWithTableView:tableView];
    
    SettingGroup * group = self.groups[indexPath.section];
    
    cell.model = group.models[indexPath.row];
    
    cell.seperatorView.hidden = (indexPath.row == (group.models.count - 1));
    
//    NSLog(@"%f",self.tableView.sectionHeaderHeight);
    
    return cell;
}



@end
